package com.tally.server.exception;

/**
 * @Author: sy
 * @Date: 2020/12/19 20:54
 * @Description:
 */
public class BusinessException extends RuntimeException {
    private BusinessExceptionCode code;

    public BusinessException(BusinessExceptionCode code){
        super(code.getDesc());
        this.code = code;
    }

    public BusinessExceptionCode getCode() {
        return code;
    }

    /**
     * 不写入堆栈信息，提高性能
     * @return
     */
    @Override
    public synchronized Throwable fillInStackTrace() {
        return this;
    }
}
